package com.ithm;

import java.util.ArrayList;
import java.util.Scanner;

public class mml {
   /* public static void main(String[] args) {
      Scanner sc=new Scanner(System.in);
      String a=sc.next();
        StringBuilder b=new StringBuilder(a);
        b.reverse();
        boolean c=b==b.reverse();
        if (true){
            System.out.println("对称的");
        }else {
            System.out.println("不对称");
        }


    }*/
   /* 定义一个方法，传入一个 int[]  返回一个有格式的字符串。
    // String s = "[3, 6, 8]"
    public static String getString(int[] arr){ //int[] arr = {3,6,8};

    }*/

    public static void main(String[] args) {
                ArrayList<String> al =new ArrayList <>();
                al.add("bdsf");
                al.add("aa");
                al.add("adgdgsd");
                al.add("c");
                al.add("adf");
                al.add("ddsghhhh");

                ArrayList<String> alist =getNewArrayList(al);
                for (int i = 0; i<alist.size(); i++){
                    System.out.println(alist.get(i)); // bdsf adgdgsd ddsghhhh
                }
            }
            public static ArrayList<String> getNewArrayList(ArrayList<String> al){
                ArrayList<String> newList=new ArrayList<>();
                for (int i = 0; i <al.size() ; i++) {
                String s=al.get(i);
                if (s.length()>3){
                newList.add(s);
            }
        }
                return newList;
    }
}
